<html>
<head>
<meta HTTP-EQUIV=CONTENT-TYPE CONTENT="text/html; charset=utf-8">
<title>Slide 22</title>
</head>
<body>
<center>
<a href="text0.html">First page</a> <a href="text20.html">Back</a> <a href="text22.html">Continue</a> <a href="text82.html">Last page</a> <a href="whatswrong.html">Overview</a> <a href="img21.html">Graphics</a></center><br>
<h1><b>Principles of API Design</b></h1><p>
<ul><li><h2>APIs are written by experts for non-experts</h2>
<li><h2>It's the class's responsibility to enforce its class invariants</h2>
<li><h2>Verify preconditions</h2>
<li><h2>Do not allow clients to do bad things.</h2>
<li><h2>Hide as much of the implementation as possible. </h2>
<li><h2>Design for subclassing or prohibit it</h2>
</ul></body>
</html>